#ifndef __MESH_H
#define __MESH_H

#include <vector>
#include "Base.h"
#include "Face.h"

class Mesh {

private:
	std::vector<Face> faces;
	
	std::vector<Point3d> vertices;
	std::vector<Point2d> textures;
	std::vector<Point3d> normals;

public:
	static const int NO_INDEX = -1;
	
	Mesh () { };
	
	void addVertex (Point3d &p) { this->vertices.push_back(p); }
	void addTexture (Point2d &p) { this->textures.push_back(p); }
	void addNormal (Point3d &p) { this->normals.push_back(p); }
	void addFace (Face &f) { this->faces.push_back(f); }
	
	
	Point3d & getVertex (int index) { return this->vertices[index-1]; }
	Point2d & getTexture (int index) { return this->textures[index-1]; }
	Point3d & getNormal (int index) { return this->normals[index-1]; }
	
	void print () {
		for (unsigned int i = 0; i < faces.size(); i++)
			faces[i].print();
	}
	
	std::vector<Face> & getFaces () { return this->faces; }
	
};

#endif